//
//  UIViewController+HUB.m
//  iOS_YouSelect
//
//  Created by 李国卿-Mac on 2018/6/25.
//  Copyright © 2018年 cong. All rights reserved.
//

#import "UIViewController+HUB.h"

@implementation UIViewController (HUB)

- (void)showHint:(NSString *)hint{
    
    [self showHub:hint WithShowTime:2.0];
}

- (void)showHudInView:(UIView *)view hint:(NSString *)hint{
    MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:view animated:YES];
    hub.labelText = hint;
    [hub hide:YES afterDelay:2.0];
    
}

- (void)showHub:(NSString *)hint WithShowTime:(NSInteger)seconds{
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.mode = MBProgressHUDModeText;
    hud.labelText = hint;
    hud.labelFont = [UIFont systemFontOfSize:16];
    hud.labelColor = [UIColor whiteColor];
    hud.opacity = 0.6;
//    hud.bezelView.backgroundColor = [Tools changeColor:@"#000000"];
//    hud.bezelView.alpha = 0.85;
    hud.minSize = CGSizeMake(255, 60);
//    CGFloat y = IS_IPHONE_5?200.f:(SCREEN_HEIGHT/2 - 84);
    [hud setYOffset:-74];
//    [hud setOffset:CGPointMake(0, -74)];
    [hud hide:YES afterDelay:seconds];
}

- (void)showHudProgress{
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
- (void)hiddenHudProgress{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}

@end
